package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface DishMapper {
    Integer countByCategoryId(Long id);

    Page<Dish> query(DishPageQueryDTO dishPageQueryDTO);

    void deleteBathids(List<Integer> ids);

    @AutoFill(OperationType.INSERT)
    void save(Dish dish);

    void insertBathFlavors(List<DishFlavor> flavors);

    Dish getById(Long id);

    void deleteById(Long id);

    @AutoFill(OperationType.UPDATE)
    void update(Dish dish);

    List<Dish> list(Dish dish);


    Integer countByStatus(Map map);
}
